{% extends 'Reg_Log_base.html' %}

{% block header %}
  <h1>{% block title %}Register{% endblock %}</h1>
{% endblock %}

{% block content %}
    <!-- auth/register.html -->
    <form method="POST" action="{{ url_for('auth.register') }}">
        {{ form.hidden_tag() }}  <!-- 必须包含CSRF令牌 -->
        
        <div class="form-group">
            {{ form.username.label }}
            {{ form.username(class="form-control", placeholder="请输入用户名") }}
            {% for error in form.username.errors %}
                <div class="alert alert-danger">{{ error }}</div>
            {% endfor %}
        </div>
        
        <div class="form-group">
            {{ form.password.label }}
            {{ form.password(class="form-control", placeholder="请输入密码") }}
            {% for error in form.password.errors %}
                <div class="alert alert-danger">{{ error }}</div>
            {% endfor %}
        </div>
        
        <div class="form-group">
            {{ form.confirm_password.label }}
            {{ form.confirm_password(class="form-control", placeholder="请确认密码") }}
            {% for error in form.confirm_password.errors %}
                <div class="alert alert-danger">{{ error }}</div>
            {% endfor %}
        </div>
        
        {{ form.submit(class="btn btn-primary") }}
    </form>
{% endblock %}